package com.kmwiki.Server;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;

import java.io.IOException;
import java.io.PrintWriter;

import com.kmwiki.Utility.*;
import com.kmwiki.Utility.Net.myHttp;

@SuppressWarnings("serial")
public class jsontest extends HttpServlet {
	
	@Override
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		String RedirectUrl = "http://%1$s.tripexplore.net/photo.jsp";
		String servername = PrjInfo.getRandomServerName();
	    RedirectUrl = String.format(RedirectUrl, servername);

	    resp.setContentType("text/html; charset=utf-8");		
		resp.getWriter().print(RedirectUrl);
		
//		String Url = myString.CheckNull(req.getParameter("url"),"http://go.tripexplore.net/gplus?path=photos&id=108979762451884041474&num=4");
//		
//	    String content = "";
//	    //String Url = "http://www.google.com.tw";
//	    //Url ="http://m.chinatimes.com/list.aspx?cid=1";
//	    //Url = "http://www.post.gov.tw/post/index.jsp";
//
//		
//	    String json = "{\"user\":\"cdsfadl\"}";
//	    
//	    resp.setContentType("application/json");  //; charset=utf-8
//	    resp.setCharacterEncoding("UTF-8");
//	    //resp.getWriter().write(json);
//	    
//	    PrintWriter out = resp.getWriter();
//	    out.write(json);
//	    out.flush();
	}
	
	
}
